#import "TYBaseView.h"

// 定义按钮切换的代理协议
@protocol ThreeButtonTitleViewDelegate <NSObject>

@optional
- (void)threeButtonTitleView:(UIView *)titleView didSelectButtonAtIndex:(NSInteger)index;

@end

// 自定义TitleView类
@interface ThreeButtonTitleView : TYBaseView

@property (nonatomic, weak) id<ThreeButtonTitleViewDelegate> delegate;
@property (nonatomic, assign) NSInteger selectedIndex; // 当前选中的按钮索引

// 初始化方法
- (instancetype)initWithFrame:(CGRect)frame
                  buttonTitles:(NSArray<NSString *> *)titles
           selectedButtonColor:(UIColor *)selectedColor
         unselectedButtonColor:(UIColor *)unselectedColor;

@end
